package io.ouka.jvm.hotspot.selfread.domain;

import java.util.Arrays;

/**
 * @author ouka
 * LineNumberTable
 */
public class LineNumberTable extends AttributeInfo {
    private int tableLength;
    private Item[] table;


    @Override
    public String toString() {
        return "LineNumberTable{" +
                "tableLength=" + tableLength +
                ", table=" + Arrays.toString(table) +
                '}';
    }

    public int getTableLength() {
        return tableLength;
    }

    public void setTableLength(int tableLength) {
        this.tableLength = tableLength;
        this.table = new Item[tableLength];
    }

    public Item[] getTable() {
        return table;
    }

    public void setTable(Item[] table) {
        this.table = table;
    }

    public class Item {
        private int startPc;
        private int lineNumber;

        public int getStartPc() {
            return startPc;
        }

        public void setStartPc(int startPc) {
            this.startPc = startPc;
        }

        public int getLineNumber() {
            return lineNumber;
        }

        public void setLineNumber(int lineNumber) {
            this.lineNumber = lineNumber;
        }

        public Item() {
        }
    }
}
